<template>
	<view class="TheWinning_wp">
		<view class="TheWinning_title">
			<image class="TheWinning_image" :src="myOrderInfoInfo.thumb" mode="widthFix"></image>
			<view class="TheWinning_My" v-if="myOrderInfoLn.isopen" :style="{color:myOrderInfoLn.color,left: myOrderInfoLn.left+'%',top:myOrderInfoLn.top+'%','font-size':myOrderInfoLn.size+'px'}">{{myOrderInfoLn.luckyno}}</view>
		</view>
		
		<view class="TheWinning_list">
			<view class="TheWinning_list_title">
				<view class="TheWinning_list_title_orderNumber">订单号</view>
				<view class="TheWinning_list_title_prize">抽奖号</view>
				<view class="TheWinning_list_title_reward">中奖</view>
			</view>
			<view class="TheWinning_list_cont" v-for="item in myOrderInfo.list">
				<view class="TheWinning_list_cont_orderNumber">
					<text>{{item.ordersn}}</text>
				</view>
				<view class="TheWinning_list_cont_prize">{{item.ordersncode}}</view>
				<view class="TheWinning_list_cont_reward">{{item.status}} </view>
			</view>
		</view>
	</view>
</template>

<script>
export default{
	data(){
		return {
			myOrderInfo:{},//我的业绩信息
			myOrderInfoInfo:{},//业绩标题信息
			myOrderInfoLn:{},//业绩抽奖状态或中奖信息与位置信息
			rankid:'',
		}
	},
	onHide() {
		// #ifdef H5
		let ua = navigator.userAgent.toLowerCase();
		if (ua.match(/MicroMessenger/i) == "micromessenger") {
			var historyUrl='/#/pages/order/TheWinning?rankid='+this.rankid;
			var href=window.location.origin+historyUrl
			history.replaceState(null, null, href);
		}
		// #endif
	},
	onLoad(options) {
		this.rankid=options.rankid?options.rankid:'';
		this.myOrderLoad();
	},
	methods:{
		//初始化我的业绩信息
		myOrderLoad(){
			
			// #ifdef H5
			let ua = navigator.userAgent.toLowerCase();
			if (ua.match(/MicroMessenger/i) == "micromessenger") {
				var url='pages/order/TheWinning?rankid='+this.rankid;
				var href=window.location.href.split('#/')[0].split('pages/')[0]+url
				history.replaceState(null, null, href)
			}
			// #endif
			
			this.$axios('ranking/myOrder','GET','shop',{rankid:this.rankid}).then(res => {
				if(res.data.code==200){
					this.myOrderInfo=res.data.data;
					this.myOrderInfoLn=this.myOrderInfo.ln;
					this.myOrderInfoInfo=this.myOrderInfo.info;
					
				}else{
					this.$api.msg(res.data.data);
				}
			},(error)=>{
				
			})
		}
	}
}
</script>

<style>
.TheWinning_wp{
	font-size: 0;
	position: relative;
}
.TheWinning_title{
	position: relative;
}
.TheWinning_image{
	width: 100%;
}
.TheWinning_My{
	position: absolute;
	font-family: '宋体';
	font-weight: bold;
	z-index: 10;
}
.TheWinning_list{
	background-color: #fff;
	border-radius: 20upx;
	box-shadow: 0 1px 10px 0.1px #F0AD4E;
	margin: -50upx 20upx 0;
	position: relative;
	padding: 0 14upx 40px;
	font-size: 28upx;
}
.TheWinning_list_title,.TheWinning_list_cont{
	border-bottom: 1px #F0AD4E solid;
	display: flex;
	justify-content: center;
	align-items: center;
}
.TheWinning_list_title_orderNumber,.TheWinning_list_title_prize,.TheWinning_list_title_reward{
	color: #da780b;
	font-size: 34upx;
	font-weight: bold;
	line-height: 80upx;
}
.TheWinning_list_title_orderNumber,.TheWinning_list_cont_orderNumber{
	flex: 2;
}
.TheWinning_list_title_prize,.TheWinning_list_cont_prize{
	flex: 1;
	text-align: center;
}
.TheWinning_list_title_reward,.TheWinning_list_cont_reward{
	flex: 1;
	text-align: center;
}
.TheWinning_list_cont_orderNumber{
	color: #da780b;
	font-size: 24upx;
	line-height: 60upx;
	overflow: hidden;
}
.TheWinning_list_cont_prize,.TheWinning_list_cont_reward{
	color: #da780b;
	font-size: 30upx;
	font-weight: bold;
	line-height: 60upx;
}
</style>
